package com.CloudDream.Gui.gui;

import com.CloudDream.Gui.MYInventoryHolder;
import com.CloudDream.Inventory.InventorySlot;
import com.CloudDream.Item.Creator;
import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;

import java.util.Arrays;
import java.util.List;

public class CookGui {

    public static final int[] BlackSlots = new int[]{0, 4, 8, 14, 15, 16, 23, 25, 32, 33, 34, 36, 44};
    public static final int[] WhiteSlots = new int[]{1, 2, 3, 5, 6, 7, 9, 13, 17, 18, 22, 26, 27, 31, 35, 37, 38, 39, 41, 42, 43};
    private static ItemStack table;

    public static Inventory open(Player p) {

        MYInventoryHolder holder = new MYInventoryHolder(p, 0);
        Inventory inv = Bukkit.createInventory(holder, 45, "§bMoonCake §7- §a月饼制作台");
        holder.setInventory(inv);
        
        ItemStack Black = new Creator(XMaterial.BLACK_STAINED_GLASS_PANE.parseMaterial(), "§7", null,15,false).get();
        ItemStack White =  new Creator(XMaterial.WHITE_STAINED_GLASS_PANE.parseMaterial(), "§7", null,0,false).get();
    
        List<String> lore = Arrays.asList("", "§7点击这里开始制作月饼");
        ItemStack Table = new Creator(XMaterial.CRAFTING_TABLE.parseMaterial(),"§a§l点击制作", lore,1,false).get();

        for (int B : BlackSlots) {
            inv.setItem(B, Black);
        }
        for (int C : WhiteSlots) {
            inv.setItem(C, White);
        }
        
        inv.setItem(InventorySlot.CRAFT_TABLEL_Location, Table);
        return inv;
    }
}
